﻿using System.Runtime.Serialization;

namespace EIP.AgreementRegistryServices
{
    [DataContract( Name = "IdentificationTokenRequest", Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class IdentificationTokenRequestType
    {
        [DataMember(Order=0)]
        public System.DateTime DateTime
        {
            get; set;
        }

        [DataMember(Order = 1)]
        public byte[] Certificate
        {
            get; set;
        }
    }

    [DataContract(Name = "Role", Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class RoleType
    {
        [DataMember(Order = 0)]
        public string Name
        {
            get;
            set;
        }

        [DataMember(Order = 1)]
        public RoleLevelType Level
        {
            get;
            set;
        }
    }

    [DataContract( Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public enum RoleLevelType
    {

        [EnumMember]
        Global,
        [EnumMember]
        Participant,
        [EnumMember]
        Service,
    }

    [DataContract( Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class ParticipantInfoType
    {
        [DataMember(Order = 0)]
        public string Name
        {
            get;
            set;
        }
    }

    [DataContract( Name = "AuthorizationTokenRequest", Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class AuthorizationTokenRequestType : IdentificationTokenRequestType
    {
        [DataMember(Order = 0)]
        public string ParticipantName { get; set; }

       [DataMember(Order = 1)]
        public string ServiceName { get; set; }

       [DataMember(Order = 2)]
        public string ServiceVersionName { get; set; }

       [DataMember(Order = 3)]
        public string MethodName { get; set; }
    }


    [DataContract( Name = "IdentificationToken", Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class IdentificationTokenType
    {

        private System.DateTime dateTimeField;

        private IdentificationTokenRequestType requestField;

        private IdentificationResultCodeType resultCodeField;

        private ParticipantInfoType participantInfoField;

        [DataMember(Order = 0)]
        public System.DateTime DateTime
        {
            get
            {
                return this.dateTimeField;
            }
            set
            {
                this.dateTimeField = value;
            }
        }

        [DataMember(Order = 1)]
        public IdentificationTokenRequestType Request
        {
            get
            {
                return this.requestField;
            }
            set
            {
                this.requestField = value;
            }
        }

        [DataMember(Order = 2)]
        public IdentificationResultCodeType ResultCode
        {
            get
            {
                return this.resultCodeField;
            }
            set
            {
                this.resultCodeField = value;
            }
        }

        [DataMember(Order = 3)]
        public ParticipantInfoType ParticipantInfo
        {
            get
            {
                return this.participantInfoField;
            }
            set
            {
                this.participantInfoField = value;
            }
        }
    }

    [DataContract( Name = "AuthorizationToken", Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public partial class AuthorizationTokenType
    {

        private System.DateTime dateTimeField;

        private AuthorizationTokenRequestType requestField;

        private AuthorizationResultCodeType resultCodeField;

        private ParticipantInfoType participantInfoField;

        private RoleType[] roleField;

        [DataMember(Order = 0)]
        public System.DateTime DateTime
        {
            get
            {
                return this.dateTimeField;
            }
            set
            {
                this.dateTimeField = value;
            }
        }

        [DataMember(Order = 1)]
        public AuthorizationTokenRequestType Request
        {
            get
            {
                return this.requestField;
            }
            set
            {
                this.requestField = value;
            }
        }

        [DataMember(Order = 2)]
        public AuthorizationResultCodeType ResultCode
        {
            get
            {
                return this.resultCodeField;
            }
            set
            {
                this.resultCodeField = value;
            }
        }

        [DataMember(Order = 3)]
        public ParticipantInfoType ParticipantInfo
        {
            get
            {
                return this.participantInfoField;
            }
            set
            {
                this.participantInfoField = value;
            }
        }

        [DataMember(Order = 4, Name = "Roles")]
        public RoleType[] Role
        {
            get
            {
                return this.roleField;
            }
            set
            {
                this.roleField = value;
            }
        }
    }

    [DataContract( Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public enum IdentificationResultCodeType
    {

        [EnumMember]
        Success,

        [EnumMember]
        CertificateExpired,

        [EnumMember]
        CertificateNotRegistered,

        [EnumMember]
        CertificateRevocated,

        [EnumMember]
        BadCertificate,
    }

    [DataContract( Namespace = "urn:ekburg.ru:eip:common:AgreementService:v1.1" )]
    public enum AuthorizationResultCodeType
    {
        [EnumMember]
        Success,

        [EnumMember]
        CertificateExpired,

        [EnumMember]
        CertificateNotRegistered,

        [EnumMember]
        CertificateRevocated,

        [EnumMember]
        BadCertificate,

        [EnumMember]
        InvalidCertificateType,

        [EnumMember]
        ParticipantNotRegistered,

        [EnumMember]
        ServiceNotRegistered,

        [EnumMember]
        ServiceVersionNotRegistered,

        [EnumMember]
        MethodNotRegistered,
    }
}
